How To Install Cacti monitoring on Ubuntu 22.04 | 20.04 - Linux Shout

2022-03-11 10:13:08 By : Mr. Xinfa Zeng

Have a look at the quick steps given in the tutorial to install Cacti on Ubuntu 22.04 Jammy JellyFish and Ubuntu 20.04 Focal Fossa server for monitoring network devices.

Cacti is an open-source tool for monitoring hosts in larger networks using SNMP (Simple Network Management Protocol). It comes with numerous ready-made scripts and data templates. Cacti is just as suitable for a server running under Linux that queries the remotely maintainable network switch as it is for recording and visualizing any other measurement data that occurs regularly. It offers itself as a framework that can be easily configured via a browser. Cacti uses the MySQL database to save its settings and the Apache webserver for interactive configuration and display of the graphics.

Cacti manage templates for graphics, hosts, and data sources that can be created using a browser. You save a lot of work if the same values ​​have to be monitored on several hosts. The visualization tool comes with ready-made templates for many systems (Linux/Unix computers, various router models).

To perform this tutorial, we need the following things:

• Ubuntu Server • RRDTool • MySQL, PHP • Web Server that supports PHP e.g. Apache, Nginx, or IIS • A non-root user with sudo rights • Internet Connection

Before moving further in this tutorial let’s first update our Ubuntu 22.04 or 20.04 server to make sure all the packages available on it are up to date. This will also regenerate the APT package manager’s cache.

To access the web interface of the Cacti monitoring server, we must have a web server installed on our Ubuntu 22.04 or 20.04. Here we are choosing popular open-source Apache.

Start and enable Apache Web server:

To store data we are using MySQL/MariaDB, whereas Cacti web UI is PHP based, hence we need this programming language installed on our system along with some extensions required by the Cacti to work properly…

Configure PHP memory and execution time:

Edit the php.ini file:

Press Ctrl+W and type-  memory_limit

And change its value from 128 to 512M

In the same way, search for max_execution_time and change its value from 30 to 300.

Find: date.timezone and set the PHP time zone according to your country.  If you don’t know about your country’s time zone format you can visit the PHP Timezones page to find out.

Save the file by pressing Ctrl+O after that hit the Enter key and use Ctrl+X to exit.

Now, also edit the PHP CLI php.ini file and set the time zone there as well.

Fins and Set time zone again:

Save the file by pressing Ctrl+O after that hit the Enter key and use Ctrl+X to exit.

Once the PHP is on our system, let’s install MySQL fork MariaDB Server available on Ubuntu 22.04 or 20.04 via its official repository using the APT package manager.

Start and enable the Database server:

Create MariaDB Database for Cacti

Copy and Add the following given line under– [mariadb]

Also, add # tag in front of these two lines available in the same file to make them unreadable:

Save the file: Ctrl+O, hit the Enter Key, and then Ctrl+X to exit.

Now, set the timezone in MySQL

We need some key tools for the proper working of Cacti monitoring systems such as SNMP and rrdtool. Therefore, in this step, we will install them.

Although Cacti can be installed using the APT package manager and Bullseye official repository, however, the version available through it will not be the latest one.

Therefore, clone the latest one available on Github:

Move the cloned Cacti files to your Web directory:

Use the Cacti SQL configuration file to pre-populate the database created for it.

Create PHP configuration file for Cacti:

Well, the Configuration file is already present inside the copied Cacti folder, we just rename it.

Now, edit the config.php and add the Database details you have created for Cacti.

Change the Database values – Database name, username, and password.

Save the file Ctrl+O, hit the Enter key, and exit: Ctrl+x.

Give Apache user permission to access the Cacti folder in the Webroot directory.

To run the Cacti poller service in the background, create a Cacti system service using the given commands.

Save the file Ctrl+O, press Enter key, and then exit Ctrl+X.

Start and enable Cacti Service 

Also restart Mariadb and Apache services:

Once the installation is completed, go to your system browser and then enter the IP address of your server where you have installed the Cacti Monitoring software.

Login Cacti with default username – admin and password – admin.

In the first step, the installation wizard will check that all the required things for Cacti working are in place. If any of the requirements are not met the same will reflect on your screen. And we have to fulfill the same then only we will be able to move forward.

In the next step, the system will ensure all the necessary permissions required by Cacti to access files are set.

By default let the “New Primary Server” be selected because it is an initial server that is going to monitor other devices.

Finally, you will have the Cacti Dashboard installed on your Ubuntu 22.04 or 20.04

This was the quick tutorial to set up Cacti Monitoring Service on Ubuntu 22.04 or 20.04, for more information on this tool and how to use it, refer to the official documentation.

• 7 Best Gnome system monitor alternative Linux applications • How to Install VidCutter on Ubuntu 22.04 | 20.04 • Install IntelliJ IDEA on Ubuntu 22.04

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Linux Shout crafted as a part of our main portal H2S Media to publish Linux related tutorials and open source Software.